import { createWebHashHistory, createRouter } from 'vue-router'

import HomeView from '../views/home/index.vue'
import login from '../views/login.vue'
import xq from '../views/xq.vue'
import swiper from '../views/swiper.vue'
import homes from '../views/home/home.vue'
import classify from '../views/home/classify.vue'
import cart from '../views/home/cart.vue'
import my from '../views/home/my.vue'
const routes = [
    { path: '/', redirect: '/login' },
    {
        path: '/home',
        component: HomeView,
        children:[
            { path: '/home', redirect: '/home/homes' },
            {
                path: 'homes',
                component: homes,
            },
            {
                path: 'classify',
                component: classify,
            },
            {
                path: 'cart',
                component: cart,
            },
            {
                path: 'my',
                component: my,
            },
        ]
    },
    {
        path: '/login',
        component: login
    },
    {
        path: '/xq',
        component: xq
    },
    {
        path: '/swiper',
        component: swiper
    },
]

export const router = createRouter({
    history: createWebHashHistory(),
    routes,
})